package ClientC;

import java.math.BigDecimal;

public class Apple extends Fruit {

    private final DiscountStrategy discountStrategy;

    public Apple(String prices, DiscountStrategy discountStrategy) {
        super("苹果", "8", prices);
        this.discountStrategy = discountStrategy;
    }

    @Override
    public BigDecimal payCount() {
        return new BigDecimal(this.prices).multiply(new BigDecimal(num)).multiply(new BigDecimal(discountStrategy.calculateDiscountFactor()));
    }
}
